/**
 * Created with IntelliJ IDEA.
 * User: ajhin
 * Date: 2/20/14
 * Time: 8:13 AM
 * To change this template use File | Settings | File Templates.
 */
package com.societyGames.codeAlong.state.codeExercise.view.status
{
import com.societyGames.flashForms.AutoScaleTextField;
import com.societyGames.utility.Fader;

public class StatusText extends AutoScaleTextField
{
  private var _fader:Fader;
  private static const FADE_IN_FADE_OUT_TIME:Number = 2;

  public function StatusText()
  {
    this.mouseEnabled = false;
    this.textColor = 0x00FF00;

    _fader = new Fader(this);
    _fader.fadeStart = 0;
    _fader.fadeEnd = 1;
    _fader.fadeInFadeOutTime = FADE_IN_FADE_OUT_TIME;
  }

  public function show(color:int = 0x000000):void
  {
    this.textColor = color;
    //this.visible = true;
    this.alpha = 1; //Start visible then fade out.
    _fader.fadeInFadeOut(0);
  }

  public function hide():void
  {
    //this.visible = false;
    _fader.stop();
  }
}
}
